//
//  NoteModel.m
//  PlayView
//
//  Created by houshijia on 16/10/9.
//  Copyright © 2016年 houshijia. All rights reserved.
//

#import "NoteModel.h"
#import "dangXiaoHeader_note.h"
@implementation NoteModel
+ (NoteModel *)modelWithDic:(NSDictionary *)dic{
    
    return [[NoteModel alloc]initWithDic:dic];
}
-(CGFloat)cellHigh{
    NSStringDrawingOptions options =  NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading;
    
    CGRect rect1 = [self.name boundingRectWithSize:CGSizeMake(MAXFLOAT,MAXFLOAT) options:options attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:12.f]} context:nil];
    CGFloat height1 = ceil(rect1.size.height);
    
    UILabel *nrLbl = [UILabel new];
    nrLbl.text = self.bjnr;
    nrLbl.numberOfLines = 0;
    nrLbl.font = NormalFont(28);
    CGRect rect2 = [nrLbl getLableHeightWithMaxWidth:SIZEWIDTH-30];
    CGFloat height2 = ceil(rect2.size.height);
    if (height2>28&&height2<30) {
        nrLbl.lineSpace = 0;

        return 20+height1+15+height2+20;
        
    }else{
        nrLbl.lineSpace = 8;
        height2 = [nrLbl getLableHeightWithMaxWidth:SIZEWIDTH-30].size.height;
        return 20+height1+15+height2+20;
    }
}
@end
